﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace WindowsGame1.View
{
    class Camera
    {
        //Totala skärmkordinaterna som dras av
        public float _offsetX;
        public float _offsetY;
        public int _resolutionX;
        public int _resolutionY;

        public Camera(int resolutionX, int resolutionY) 
        {
            _resolutionX = resolutionX;
            _resolutionY = resolutionY;
            _offsetX = (int)(resolutionX * 0.05);
            _offsetY = (int)(resolutionY * 0.05);
        }

        public Vector2 GetVisualCoords(Vector2 logicalVector, bool withOffset = false) 
        {
            if(withOffset)
            {
                return new Vector2(logicalVector.X * (_resolutionX - _offsetX),
                logicalVector.Y * (_resolutionY - _offsetY));
            }
            return new Vector2(logicalVector.X * _resolutionX,
                logicalVector.Y * _resolutionY);
        }
    }
}
